﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>focus.html</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script type="text/javascript" src="../js/jquery-1.8.2.js"></script>
  </head>
  <body>
	
	<input type="text" value="加载页面时获取光标并选中所有文字" size="50"/>	
	
	<script type="text/javascript">
		//加载页面时获取光标并选中所有文字
		$(function(){
			//光标定位文本框
			$(":text").focus();
			//选中文本框的所有文本
			$(":text").select();
		});
	</script>
  
  </body>
</html>
